#include "catch2/catch.hpp"
#include "ebu/list/ptp/message.h"
using namespace ebu_list;
using namespace ebu_list::ptp;

//------------------------------------------------------------------------------

SCENARIO("ts80 decoding")
{
    REQUIRE(to_ts80(to_byte_array(0x00, 0x00, 0x45, 0xb1, 0x11, 0x49, 0x2e, 0x32, 0x42, 0x63)) ==
            ts80(1169232201, 775045731));
    REQUIRE(to_ts80(to_byte_array(0x00, 0x00, 0x56, 0x27, 0xe1, 0x55, 0x07, 0x93, 0x0e, 0x70)) ==
            ts80(1445454165, 127078000));
    REQUIRE(to_ts80(to_byte_array(0xA4, 0x32, 0x45, 0xb1, 0x11, 0x49, 0x2e, 0x32, 0x42, 0x63)) ==
            ts80(0xa43245b11149, 0x2e324263));
    REQUIRE(to_ts80(to_byte_array(0x00, 0x00, 0x58, 0x9b, 0x33, 0x14, 0x39, 0xd8, 0x97, 0xbe)) ==
            ts80(1486566164, 970495934));
}
